package fhp.hlhj.giantfold.presenter

import com.lzy.okgo.model.HttpParams
import fhp.hlhj.giantfold.interfaces.IGoodsDetail
import fhp.hlhj.giantfold.javaBean.ErroBean
import fhp.hlhj.giantfold.javaBean.GoodsDetailBean
import fhp.hlhj.giantfold.module.GoodsDetailModule

/**
 * author: FHP
 * data: on 2017\12\5 0005 15:13
 * E-Mail: 103945089@qq.com
 */
class GoodsDetailPresenter(private val iGoodsDetail: IGoodsDetail) : GoodsDetailModule.goodsDetailLoadingListener {
    override fun showLoading() {
        iGoodsDetail.showLoading()
    }

    override fun over(goodsDetailBean: GoodsDetailBean) {
        iGoodsDetail.getGoodsDetail(goodsDetailBean)
    }

    override fun erro(erro: ErroBean) {
        iGoodsDetail.onError(erro)
    }

    private val goodsDetailModule=GoodsDetailModule()

    fun getGood(params: HttpParams,goodsId:String){
        goodsDetailModule.getGoodsInfo(params,goodsId,this)
    }
}